# makefile for creating itLib
# compile the cpp files to object files .o
# then pack them into a library using ar


#define variables

OBJ = word32.o word64.o BitVector32.o lfsr32.o corrAttack.o
INC = ../include
vpath %.h ../include
CFLAGS = -std=c++11 -Wall

#create itLib
libitLib.a : $(OBJ)
	ar cvr libitLib.a $(OBJ) 

#compile word32
word32.o: word32.cpp word32.h
	g++ $(CFLAGS) -c -I $(INC) word32.cpp

#compile word64
word64.o: word64.cpp word64.h
	g++ $(CFLAGS) -c -I $(INC) word64.cpp

#compile BitVector32
BitVector32.o: BitVector32.cpp BitVector32.h word32.h
	g++ $(CFLAGS) -c -I $(INC) BitVector32.cpp

#compile lfsr32
lfsr32.o: lfsr32.cpp lfsr32.h word32.h
	g++ $(CFLAGS) -c -I $(INC) lfsr32.cpp
   
#compile corrAttack
corrAttack.o: corrAttack.cpp corrAttack.h lfsr32.h BitVector32.h word32.h
	g++ $(CFLAGS) -c -I $(INC) corrAttack.cpp

#removing binary and object files
clean: 
	rm -f *~ *.o *.a





